package com.study.system.edugatewayservice.config;

import jakarta.annotation.Resource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.List;
import java.util.Set;

/**
 * 白名单配置
 */
//@ConfigurationProperties(prefix = "user-login-validate")
@Configuration
public class WhiteListConfig {

    public static final String KEY = "white-list";

    @Resource
    private RedisTemplate<String,Object> redisTemplate;


    public Set<Object> getWhiteList() {
        Set<Object> whiteList = redisTemplate.opsForSet().members(KEY);
        return whiteList;
    }

    public void setWhiteList(Object... urls) {
        redisTemplate.opsForSet().add(KEY,urls);
    }
}
